package kr.hkit.powerjava.project_cafe;

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.ArrayList;

import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class Product_Service  {

	
	private ProductDAO dao;
	
	
	public Product_Service(ProductDAO dao) {
		this.dao = dao;
	}
	
	public void insertData(Product prod) { //입력
		
		JOptionPane.showMessageDialog(null, prod);

		try {
			dao.insertItems(prod);
			JOptionPane.showMessageDialog(null, "입력되었습니다.");
		} catch (SQLException e1) {
			JOptionPane.showMessageDialog(null, "입력실패! 다시 확인바랍니다.");
		}
	}
	
}
